<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<style type="text/css">
	     
	.box{
						
			float: left;
		}
   .dou{
    	width: 145px;
    	float: left;
    }
	</style>
	<script type="text/javascript">
		window.onload = function  () {
			 box = document.getElementById('box');
			 num = 0;
			 /*获取元素中所有可用的css属性*/
			 function run () {
			 	boxwidth = window.getComputedStyle ? window.getComputedStyle(box,null).width : box.currentStyle.width;
			 	boxHeight = window.getComputedStyle ? window.getComputedStyle(box,null).height : box.currentStyle.height;
			 	// 宽
			 	if(parseInt(boxwidth)>=1191){
			 		num =1;
				 }else if(parseInt(boxwidth)<=0){
				 	num =0;
				 }
				 /*解析*/
				 if(num==1){
				 	newWidth = parseInt(boxwidth)-2;

			 	}else{

			 		newWidth = parseInt(boxwidth)+2;			 		
			 	}
			 	/*CSS元素控制宽度*/
			 	box.style.width = newWidth+"px";			
			 }		
			startbtn.onclick = function (){
				/*周期（以毫秒计）来调用函数*/
				time = setInterval(run, 1);
			}
			stopbtn = document.getElementById('stopbtn');
			stopbtn.onclick = function  (argument) {
				clearInterval(time);
			}
			fi(boxwidth=1191){
				fd.onclick = 
			}
		}
	</script>
</head>
<body>
	<input type="button" value="停止" id="stopbtn">
	<input type="button" value="开始" id="startbtn">
	<div class="top"><div class="box" id="box"><img src=""></div></div>
    <div class="top"><div class="dou" id="box"><img src="./Gou.GIF"></div></div>
</body>
</html>